import {lazy} from 'react'

export let mainRouter=[
    {
        path:'/home/shou',
        element:lazy(()=> import('../views/Home/Shou')),
        title:'首页'
    },
    {
        path:'/home/classify',
        element:lazy(()=> import('../views/Home/Classify')),
        title:'分类'
    },
    {
        path:'/home/cart',
        element:lazy(()=> import('../views/Home/Cart')),
        title:'购物车'
    }
]

const routes = [
    {
        path:'*',
        element:lazy(()=> import('../views/Error'))
    },
    {
        path:'/home',
        element:lazy(()=> import('../views/Home')),
        children:mainRouter
    },
    {
        path:'/detail/:id',
        element:lazy(()=> import('../views/Detail'))
    },
    {
        path:'/login',
        element:lazy(()=> import('../views/Login'))
    },
    {
        from:'/',
        to:'/home/shou'
    }
]

export default routes;